/*
 * UMLSynch RMI functionality test
 * http://umlsynch.googlecode.com
 *
 * Copyright 2008-2010, Evgeny Alexeyev
 * Licensed under the EPL - v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */

package com.googlecode.umlsynch.rpc.test;

import java.awt.GridLayout;

import javax.swing.BoxLayout;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.googlecode.umlsynch.rpc.base.TConfig;

public class TConfigPanel extends JPanel {
	public TConfig cfg = null;

    public TConfigPanel()    {
    	cfg = new TConfig();
    	CreateUI();
    }
    
    public TConfigPanel(TConfig config) {
    	cfg = config;
    	CreateUI();
    }
    
    
    private void CreateUI() {
        setLayout(new GridLayout(3, 2));
		JLabel jHostname= new JLabel("Hostname:");
		add(jHostname);
		
		JTextField jTHostname = new JTextField(cfg.hostname);
		add(jTHostname);

		JLabel jPort= new JLabel("Port:");
		add(jPort);
		
		JTextField jTPort = new JTextField("" + cfg.port);
		add(jTPort);
		
		JLabel jProtocol= new JLabel("Protocol:");
		add(jProtocol);
		
		String[] protocols = {"Simple RMI", "RMI", "CORBA", "DCOM", "XMLRPC"};
		JComboBox jproto = new JComboBox(protocols);
		int index = 0; 
		add(jproto);

    }

}
